package com.kd.enums.product;

/**
 * 面板腿型枚举
 */
public enum PanelLegEnum {
    SLAB_LOG(0, "板条-原木"),
    PLYWOOD_MULTILAYER(1, "胶合板-多层板");

    private final Integer code;
    private final String desc;

    PanelLegEnum(Integer code, String desc) {
        this.code  = code;
        this.desc  = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PanelLegEnum getByCode(Integer code) {
        for (PanelLegEnum value : values()) {
            if (value.getCode().equals(code))  {
                return value;
            }
        }
        throw new IllegalArgumentException("无效的面板腿型代码: " + code);
    }
}